; Music of Airwolf (1985) (Elite System Ltd.)
; Ripped by Megachur the 04/02/2009

; Need System Vectors

	write "AIRWOLF.BIN"

music_date_rip	equ &0429
music_adr	equ &64e8
first_theme	equ 0
last_theme	equ 0	; 0 -> 0

	read "music_header_v1_0.asm"

.l64e8
	db #1c,#01,#38,#02,#2f,#00,#00,#00
	db #00,#00,#3b,#00,#00,#00,#7b,#01
	db #47,#00,#d4,#00,#38,#02,#2f,#00
	db #bd,#00,#00,#00,#3b,#00,#9f,#00
	db #7b,#01,#47,#00,#8e,#00,#38,#02
	db #2f,#00,#00,#00,#00,#00,#3b,#00
	db #00,#00,#7b,#01,#47,#00,#77,#00
	db #38,#02,#2f,#00,#7e,#00,#00,#00
	db #3b,#00,#9f,#00,#7d,#02,#47,#00
	db #8e,#00,#38,#02,#2f,#00,#00,#00
	db #00,#00,#3b,#00,#00,#00,#7b,#01
	db #47,#00,#77,#00,#38,#02,#2f,#00
	db #7e,#00,#00,#00,#3b,#00,#9f,#00
	db #7b,#01,#47,#00,#8e,#00,#38,#02
	db #2f,#00,#00,#00,#00,#00,#3b,#00
	db #00,#00,#7b,#01,#47,#00,#9f,#00
	db #38,#02,#2f,#00,#00,#00,#00,#00
	db #3b,#00,#7e,#00,#7d,#02,#47,#00
	db #bd,#00,#38,#02,#2f,#00,#00,#00
	db #00,#00,#3b,#00,#00,#00,#7b,#01
	db #47,#00,#d4,#00,#38,#02,#2f,#00
	db #00,#00,#00,#00,#3b,#00,#00,#00
	db #7b,#01,#47,#00,#ee,#00,#38,#02
	db #2f,#00,#00,#00,#00,#00,#3b,#00
	db #d4,#00,#7b,#01,#47,#00,#fd,#00
	db #38,#02,#2f,#00,#00,#00,#00,#00
	db #3b,#00,#3e,#01,#7d,#02,#47,#00
	db #1c,#01,#38,#02,#2f,#00,#00,#00
	db #00,#00,#3b,#00,#00,#00,#7b,#01
	db #47,#00,#d4,#00,#38,#02,#2f,#00
	db #bd,#00,#00,#00,#3b,#00,#9f,#00
	db #7b,#01,#47,#00,#8e,#00,#38,#02
	db #2f,#00,#00,#00,#00,#00,#3b,#00
	db #00,#00,#7b,#01,#47,#00,#77,#00
	db #38,#02,#2f,#00,#7e,#00,#00,#00
	db #3b,#00,#9f,#00,#7d,#02,#47,#00
	db #8e,#00,#38,#02,#2f,#00,#00,#00
	db #00,#00,#3b,#00,#00,#00,#7b,#01
	db #47,#00,#77,#00,#38,#02,#2f,#00
	db #7e,#00,#00,#00,#3b,#00,#9f,#00
	db #7b,#01,#47,#00,#8e,#00,#38,#02
	db #2f,#00,#00,#00,#00,#00,#3b,#00
	db #00,#00,#7b,#01,#47,#00,#9f,#00
	db #38,#02,#2f,#00,#00,#00,#00,#00
	db #3b,#00,#7e,#00,#7d,#02,#47,#00
	db #bd,#00,#38,#02,#2f,#00,#00,#00
	db #00,#00,#3b,#00,#00,#00,#7b,#01
	db #47,#00,#d4,#00,#38,#02,#2f,#00
	db #00,#00,#00,#00,#3b,#00,#00,#00
	db #7b,#01,#47,#00,#ee,#00,#38,#02
	db #2f,#00,#00,#00,#00,#00,#3b,#00
	db #d4,#00,#7b,#01,#47,#00,#fd,#00
	db #38,#02,#2f,#00,#00,#00,#00,#00
	db #3b,#00,#3e,#01,#7d,#02,#47,#00
	db #ee,#00,#38,#02,#2f,#00,#00,#00
	db #00,#00,#3b,#00,#00,#00,#7d,#02
	db #47,#00,#b2,#00,#e3,#03,#3b,#00
	db #9f,#00,#00,#00,#2f,#00,#86,#00
	db #7d,#02,#27,#00,#77,#00,#e3,#03
	db #3b,#00,#00,#00,#00,#00,#2f,#00
	db #00,#00,#7d,#02,#27,#00,#59,#00
	db #e3,#03,#3b,#00,#5e,#00,#00,#00
	db #2f,#00,#86,#00,#7d,#02,#27,#00
	db #77,#00,#bb,#03,#3b,#00,#00,#00
	db #00,#00,#2f,#00,#00,#00,#30,#04
	db #27,#00,#59,#00,#bb,#03,#3b,#00
	db #5e,#00,#00,#00,#2f,#00,#86,#00
	db #7d,#02,#27,#00,#77,#00,#bb,#03
	db #3b,#00,#00,#00,#00,#00,#2f,#00
	db #00,#00,#7d,#02,#27,#00,#86,#00
	db #bb,#03,#3b,#00,#00,#00,#00,#00
	db #2f,#00,#6a,#00,#7d,#02,#27,#00
	db #9f,#00,#bb,#03,#3b,#00,#00,#00
	db #00,#00,#2f,#00,#00,#00,#30,#04
	db #27,#00,#b2,#00,#bb,#03,#3b,#00
	db #00,#00,#00,#00,#2f,#00,#00,#00
	db #7d,#02,#27,#00,#bd,#00,#bb,#03
	db #3b,#00,#00,#00,#00,#00,#2f,#00
	db #b2,#00,#7d,#02,#27,#00,#d4,#00
	db #bb,#03,#3b,#00,#00,#00,#00,#00
	db #2f,#00,#0c,#01,#7d,#02,#27,#00
	db #ee,#00,#bb,#03,#3b,#00,#00,#00
	db #00,#00,#2f,#00,#00,#00,#30,#04
	db #27,#00,#b2,#00,#bb,#03,#3b,#00
	db #9f,#00,#00,#00,#2f,#00,#86,#00
	db #7d,#02,#27,#00,#77,#00,#bb,#03
	db #3b,#00,#00,#00,#00,#00,#2f,#00
	db #00,#00,#7d,#02,#27,#00,#59,#00
	db #bb,#03,#3b,#00,#5e,#00,#00,#00
	db #2f,#00,#86,#00,#7d,#02,#27,#00
	db #77,#00,#bb,#03,#3b,#00,#00,#00
	db #00,#00,#2f,#00,#00,#00,#30,#04
	db #27,#00,#59,#00,#bb,#03,#3b,#00
	db #5e,#00,#00,#00,#2f,#00,#86,#00
	db #7d,#02,#27,#00,#77,#00,#bb,#03
	db #3b,#00,#00,#00,#00,#00,#2f,#00
	db #00,#00,#7d,#02,#27,#00,#43,#00
	db #bb,#03,#3b,#00,#47,#00,#00,#00
	db #2f,#00,#59,#00,#7d,#02,#27,#00
	db #4f,#00,#bb,#03,#3b,#00,#00,#00
	db #00,#00,#2f,#00,#00,#00,#30,#04
	db #27,#00,#00,#00,#bb,#03,#3b,#00
	db #00,#00,#00,#00,#2f,#00,#00,#00
	db #7d,#02,#27,#00,#00

.l6ab3 equ $ + 3
.l6ab2 equ $ + 2
.l6ab1 equ $ + 1
.l6ab0
	db #00,#00,#00,#00,#00
.l6ab5
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00
;
.real_init_music
;
	ld a,#07
	ld c,#18
	call #bd34
	ld a,#06
	ld c,#0a
	call #bd34
	ld a,#08
	ld c,#0b
	call #bd34
	ld a,#09
	ld c,#0b
	call #bd34
	ld a,#0a
	ld c,#10
	call #bd34
	ld a,#0d
	ld c,#0a
	call #bd34
	ld a,#0b
	ld c,#9b
	call #bd34
	ld a,#0c
	ld c,#00
	call #bd34
	ld hl,l64e8
	ld (l6ab3),hl
	ld a,#8c
	ld (l6ab2),a
	ld b,#96
	ld a,#07
	ld (l6ab1),a
	ret
.l6b09
	ld hl,(l6ab3)
	ld a,(hl)
	or a
	jr z,l6b1f
	ld a,#00
	ld c,(hl)
	call #bd34
	inc hl
	ld a,#01
	ld c,(hl)
	call #bd34
	jr l6b20
.l6b1f
	inc hl
.l6b20
	inc hl
	ld a,(hl)
	or a
	jr z,l6b34
	ld a,#02
	ld c,(hl)
	call #bd34
	inc hl
	ld a,#03
	ld c,(hl)
	call #bd34
	jr l6b35
.l6b34
	inc hl
.l6b35
	inc hl
	inc hl
	inc hl
	ld (l6ab3),hl
	ld a,(l6ab2)
	dec a
	ld (l6ab2),a
	ret nz
	ld hl,l64e8
	ld (l6ab3),hl
	ld a,#8c
	ld (l6ab2),a
	ret
;
.init_music_interrupt
;
	ld b,#81
	ld c,#00
	ld de,l6b5d
	ld hl,l6ab5
	call #bcd7
	ret
;
.play_music
.l6b5d
;
	push hl
	push bc
	push af
	push de
	ld a,(l6ab1)
	dec a
	cp #00
	ld (l6ab1),a
	jr nz,l6b74
	call l6b09
	ld a,#07
	ld (l6ab1),a
.l6b74
	pop de
	pop af
	pop bc
	pop hl
	ret
.l6b79
	push bc
	ld a,#0c
	ld c,#02
	call #bd34
	ld a,#06
	ld c,#0f
	call #bd34
	ld a,#0d
	ld c,#09
	call #bd34
	pop bc
	ld a,#01
	ld (l6ab0),a
	ret
	ld a,#0d
	ld c,#0a
	call #bd34
	ld a,#0c
	ld c,#00
	call #bd34
	ld a,#06
	ld c,#0a
	call #bd34
	ret
	db #00,#00,#00,#00,#00
;
.init_music	; added by Megachur
;
	call real_init_music
	jp init_music_interrupt

;
.game_name
	db "Airwolf",0
.game_year
	db "1985",0
.game_publisher
	db "Elite System Ltd.",0
.music_author
	db "",0
.music_comment
	db "",0

	read "music_end_v1_0.asm"
